You can't write everything you would in a text file in an XML file. Sometimes because certain characters such as <,> or – are used in the XML language itself and other times because the XML specification (http://www.w3.org/TR/xml/) has been very careful to normalize some strings and not others. So lets cover some of the basics of using special characters in XML and in the comments within an XML document.
So firstly lets figure out how to have XML written inside of XML that isn't interpreted by DTF. This is achieved quite easily using the CDATA encoding like so:
Anything written between is preserved exactly as is and can contain any characters you'd like. Another situation that sometimes comes up is when you want to write special characters into the attribute value of a given tag. Here is where the XML specification gives us some trouble, because they have defined that attribute values must be normalized. This normalization basically converts tabs into a single space which can be quite annoying and unexpected. In order to work around this you can do the following:
So you basically have to use the XML special characters when dealing with attribute values. This means that if you wanted to have more complicated data with different whitespace characters you should probably use an underlying text node to your tag and not store this data in the XML attribute.
The only thing really missing is special characters within comments and the only characters that you can't use inside of an XML comment are the – characters because they confuse most parsers when it comes to knowing where the comment starts and ends. XML comments are contained between <-- and -->.